package com.abc.invoke.server.db.session;

import java.util.Hashtable;

import com.abc.invoke.server.db.system.SystemBackend;
import com.abc.invoke.server.db.system.SystemPR;
import com.abc.invoke.server.db.user.UserBackend;
import com.abc.invoke.server.db.user.UserPR;

public class SpringInvokerBackendContainer {

	private SpringInvokerDBSession session;
	private Hashtable<Class<?>, Object> backendServices = new Hashtable<Class<?>, Object>();

	public SpringInvokerBackendContainer(SpringInvokerDBSession session) {
		this.session = session;
	}

	public void createPRs() {
		backendServices.put(UserBackend.class, new UserPR());
		backendServices.put(SystemBackend.class, new SystemPR());
	}
	
	public Object getLegacyService(Class<?> cls){
		final Object obj=backendServices.get(cls);
		if(obj==null){
			System.err.println(cls.getName()+" not implemented");
		}
		return obj;
	}
}
